Sketch in a functional, cross-platofrm help.
authorrobertl <robertl>
Mon, 20 Jul 2009 01:38:38 +0000 (01:38 +0000)
committerrobertl <robertl>
Mon, 20 Jul 2009 01:38:38 +0000 (01:38 +0000)
gui/help.cpp
gui/help.h
gui/help/gpsbabel.html [new file with mode: 0644]

index d424f088bc3c01636c016ecbe87f3edbbcf39af7..c8ae3b264da5a39d4f3ac67dda7437bc593ce2d5 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: help.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: help.cpp,v 1.2 2009/07/20 01:38:38 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
 //------------------------------------------------------------------------
 #include "help.h"
 #include <QApplication>
-#include <QString>
-#include <QProcess>
-
-
-//------------------------------------------------------------------------
-#ifndef _WIN32
-void ShowUrl(const QString &url) 
-{
-  QString progName = QApplication::applicationDirPath() + "/showUrl.sh";
-  QStringList args;
-  args << url;
-  QProcess::startDetached(progName, args);
-}
-#else
-#include <windows.h>
-void ShowUrl(const QString &url) 
-{
-  ShellExecuteA(0, "open", url.toStdString().c_str(), 0, 0, SW_SHOWNORMAL);
-}
-#endif
+// #include <QProcess>
+// #include <QString>
+#include <QUrl>
+#include <QWebView>
 
 //------------------------------------------------------------------------
 void ShowHelp(const char *name)
 {
-  QString urlname = "file://" + QApplication::applicationDirPath() + "/help/" + name;
-  ShowUrl(urlname);
+  QUrl urlname("file://" + QApplication::applicationDirPath() + 
+                "/help/" + name);
+  // FIXME(robertl): This shoud probably parent from QApplication::mainWidget();
+  QWebView *view = new QWebView();
+  view->setWindowTitle("GPSBabel Help");
+  view->load(urlname);
+  view->show();
 }
 
index 838747e4203c6d70e021915c6912321b7d8d70a7..7c8da1450a2cdfa39fd300aca0f12c9daeb31ae1 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-\r
-// $Id: help.h,v 1.1 2009/07/05 21:14:56 robertl Exp $\r
+// $Id: help.h,v 1.2 2009/07/20 01:38:40 robertl Exp $\r
 //------------------------------------------------------------------------\r
 //\r
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.\r
@@ -23,7 +23,6 @@
 #ifndef HELP_H\r
 #define HELP_H\r
 #include <QString>\r
-extern void ShowUrl(const QString &url);\r
 extern void ShowHelp(const char *name);\r
 \r
 #endif\r
diff --git a/gui/help/gpsbabel.html b/gui/help/gpsbabel.html
new file mode 100644 (file)
index 0000000..fd07cbc
--- /dev/null
@@ -0,0 +1,3 @@
+<p>This is the local help.  It currently isn't very helpful.</p>
+<p>The <a href="http://www.gpsbabel.org/htmldoc-development"> online help 
+   is mo betta.</p>